package com.esdut.ciremember;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
/**
 * @Company  CiJI
 * @Classname
 * @Description TODO 调用有道翻译接口
 * @Author wenXin
 * Date 2021.6.29 20.11
 * Version 1.0
 */
public class Detail extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail);

        WebView myWebView = (WebView) findViewById(R.id.webView);
        myWebView.setWebViewClient(new WebViewClient());

        WebSettings settings = myWebView.getSettings();
        myWebView.setInitialScale(200);
        settings.setSupportZoom(true);
        settings.setLoadWithOverviewMode(true);
        settings.setUseWideViewPort(true);
        settings.setLoadWithOverviewMode(true);
        //定义u获取单词
        String u = getIntent().getStringExtra("word");
        //调用有道翻译接口
        myWebView.loadUrl("https://m.youdao.com/dict?le=eng&q=" + u);

    }

}